package com.example.sys.pay.controller;

import com.example.sys.pay.service.SysPayService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping(value = "pay")
@RestController
public class SysPayAnonController {

    @Resource
    private SysPayService sysPayService;

    @PostMapping(value = "notify")
    public String notify(@RequestBody String notifyData) {
        try {
            return sysPayService.notify(notifyData);
        } catch (Exception e) {
            return e.getMessage();
        }
    }
}
